package ge.modules.utils;

public interface IWebCallModule
{
	public enum WebCallState
	{
		/**
		 * Not send, waiting to the order to be sent
		 */
		NOT_SEND,
		/**
		 * Message is sent, waiting to response
		 */
		IN_PROCESS,
		/**
		 * Error, see message for extra info
		 */
		ERROR,
		/**
		 * Message has been sent and is ready to be read
		 */
		SENT,
		/**
		 * Data loaded is just read.
		 */
		READED
	}
	/**
	 * 
	 * @return The url direction to be called
	 */
	public String getCall();
	/**
	 * 	
	 * @return The request data to be sent with the call
	 */
	public String getRequestData();
	
	/**
	 * 
	 * @return The actual state of the call
	 */
	
	public WebCallState getState();
	/**
	 * 
	 * @return ExtraInformation
	 */
	public String getStateMessage();
	/**
	 * 	Sets a new state to the call
	 * @param state call state
	 * @param message Extra information
	 */
	public void setState(WebCallState state,String message);
	/**
	 * 	Sets  content and the state call is SENT
	 * 	That is a JSNI friend function in the place of setState
	 * @param message
	 */
	public void setContent(String message);
	
	/**
	 *  	Sets content and the state call is ERROR
	 *  That is a JSNI friend function in the place of setState
	 * @param message
	 */
	public void setError(String message);
}
